a = []
b = input()
for i in b:
    if i == '(':
        a.append(i)
    if i == ')' and len(a) > 0 and a[-1] == '(':
        a.pop()
    if i == '[':
        a.append(i)
    if i == ']' and len(a) > 0 and a[-1] == '[':
        a.pop()
    if i == '{':
        a.append(i)
    if i == '}' and len(a) > 0 and a[-1] == '{':
        a.pop()
    if i == '<':
        a.append(i)
    if i == '>' and len(a) > 0 and a[-1] == '<':
        a.pop()
if len(a) == 0:
    print('Верная')
elif len(a) != 0:
    print('Неверная')
